package com.acwing.partition37;

import java.io.*;

/**
 * @author rkc
 * @date 2022/7/19 9:25
 */
public class AC3625幂次方 {

    private static final int MOD = 233333;

    private static StreamTokenizer tokenizer = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
    private static PrintWriter writer = new PrintWriter(new OutputStreamWriter(System.out));

    public static void main(String[] args) throws IOException {
        int x = nextInt(), n = nextInt();
        writer.println(qmi(x, n));
        writer.flush();
    }

    private static long qmi(long a, int b) {
        long res = 1;
        while (b != 0) {
            if ((b & 1) == 1) res = res * a % MOD;
            b >>= 1;
            a = a * a % MOD;
        }
        return res;
    }

    private static int nextInt() throws IOException {
        tokenizer.nextToken();
        return (int) tokenizer.nval;
    }
}
